# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=py3-commentjson
pkgver=0.9.0
pkgrel=2
pkgdesc="helps creating JSON files with Python and JavaScript style inline comments"
url="https://github.com/vaidik/commentjson"
arch="noarch"
license="MIT"
depends="
	python3
	py3-lark-parser
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-six
	python3-tests
	"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/vaidik/commentjson/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/commentjson-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/commentjson/tests
}

sha512sums="
cd3d28adecbc445ed3faed7847c65a23829f408cf8aa3fa85544a0f0cf9fa5544b8aff560725cf51921f249123daf9ce9953069e99ca64a312bb4bff652512fe  py3-commentjson-0.9.0.tar.gz
"
